import api from '@/services';

function pluginService (url, params, headType, ...arguements) {
  let res = url.split(' ');

  if (res[0] === "POST") {
    return api({
      url: res[1],
      method: res[0],
      data: params,
      headType: headType,
      ...arguements
    });
  }

  return api({
    url: res[1],
    method: res[0],
    params: params,
    headType: headType,
    ...arguements
  });
}

export default pluginService
